package ar.edu.unq.tpi.constriu.c1.tejeda.Dominio.Agenda;

import java.util.Map;

import org.uqbar.commons.model.Home;


public class DefaultPersistentHomeFactory implements HomeFactory {

	@Override
	public void addHomes(Map<Class<?>, Home<?>> homes) {
		homes.put(Contact.class, new DB4OHomeImpl<Contact>(Contact.class));
		//homes.put(MedioDePago.class, new DB4OHomeImpl<MedioDePago>(MedioDePago.class));
		//homes.put(Pelicula.class, new DB4OHomeImpl<Pelicula>(Pelicula.class));
		
	}
	
	
	
	private void addHome(Map<Class<?>, Home<?>> homes, Class... entityType) {
		for (Class clazz : entityType) {
			homes.put(clazz, this.createHome(clazz));
		}
	}

	protected DB4OHomeImpl<Contact> createHome(Class clazz) {
		return new DB4OHomeAutomaticSearch(clazz);
	}

}
